<!DOCTYPE html>
<html lang="en">
<head>
    {include file='public/header' /}
    <!-- Bootstrap Dropify CSS -->
    <link href="__PUBLIC__/admin/vendors/bower_components/dropify/dist/css/dropify.min.css" rel="stylesheet" type="text/css"/>

    <!-- Custom CSS -->
    {include file='public/comn_css' /}
</head>
<body>
<!--Preloader-->
<div class="preloader-it">
    <div class="la-anim-1"></div>
</div>
<!--/Preloader-->
<div class="wrapper  theme-5-active pimary-color-blue">

    <!-- Top Menu Items -->
    {include file='public/top_menu' /}
    <!-- /Top Menu Items -->

    <!-- Left Sidebar Menu -->
    {include file='public/sidebar' /}
    <!-- /Left Sidebar Menu -->

    <!-- Main Content -->
    <div class="page-wrapper">
        <div class="container-fluid">
            <!-- Title -->
            <div class="row heading-bg">
                <div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
                    <h5 class="txt-dark">幻灯片分类</h5>
                </div>
                <!-- Breadcrumb -->
                <div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
                    <ol class="breadcrumb">
                        <li><a href="{:url('admin/index/index')}">系统首页</a></li>
                        <li><a href="{:url('admin/banner_category/index')}">幻灯片分类</a></li>
                        <li class="active"><span>添加分类</span></li>
                    </ol>
                </div>
                <!-- /Breadcrumb -->
            </div>
            <!-- /Title -->

            <!-- Row -->
            <div class="row">
                <div class="col-lg-12 col-sm-12">
                    <div class="panel panel-default card-view">
                        <div class="panel-wrapper collapse in">
                            <div class="panel-body">
                                <form class="form-horizontal" id="system_form" method="post" action="{:url('admin/banner_category/doAdd')}" enctype="multipart/form-data">
                                    <div class="form-group">
                                        <label class="control-label mb-10 col-sm-2" for="title">分类名称:</label>
                                        <div class="col-sm-8">
                                            <input type="text" class="form-control" id="title" name="title" placeholder="请输入 分类名称" value="" required>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-offset-2 col-sm-10">
                                            <button type="submit" class="btn btn-success"><span class="btn-text">提交</span></button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- /Row -->

        </div>
        <!-- Footer -->
        {include file='public/footer' /}
        <!-- /Footer -->

    </div>
    <!-- /Main Content -->

</div>
<!-- /#wrapper -->

<!-- JavaScript -->

<!-- jQuery -->
<script src="__PUBLIC__/admin/vendors/bower_components/jquery/dist/jquery.min.js"></script>

<!-- Bootstrap Core JavaScript -->
<script src="__PUBLIC__/admin/vendors/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>

<!-- Bootstrap Daterangepicker JavaScript -->
<script src="__PUBLIC__/admin/vendors/bower_components/dropify/dist/js/dropify.js"></script>

<!-- Slimscroll JavaScript -->
<script src="__PUBLIC__/admin/dist/js/jquery.slimscroll.js"></script>

<!-- Fancy Dropdown JS -->
<script src="__PUBLIC__/admin/dist/js/dropdown-bootstrap-extended.js"></script>

<!-- Owl JavaScript -->
<script src="__PUBLIC__/admin/vendors/bower_components/owl.carousel/dist/owl.carousel.min.js"></script>

<!-- Switchery JavaScript -->
<script src="__PUBLIC__/admin/vendors/bower_components/switchery/dist/switchery.min.js"></script>

<!-- Init JavaScript -->
{include file='public/comn_js' /}

<script src="__PUBLIC__/admin/dist/js/jquery.form.js"></script>
<script src="__PUBLIC__/admin/vendors/layer/layer.js"></script>
<script>
    $('#system_form').submit(function() {
        var index;
        // submit the form
        $(this).ajaxSubmit({
            beforeSubmit: function () {
                index = layer.load(1, {shade:[0.6, '#000']});
            },
            success: function (responseText, statusText) {
                if (responseText)
                {
                    layer.msg('添加成功！', {shade: [0.6, '#000'], time:3000}, function () {
                        window.location.href="{:url('index')}";
                    });
                } else {
                    layer.msg('添加失败！', {shade: [0.6, '#000'], time:3000}, function () {
                        $('#system_form').reset();
                    });
                }
            }
        });
        // return false to prevent normal browser submit and page navigation
        return false;
    });
</script>
</body>
</html>